<?php
/**************************************************************************************************
| Software Name        : OPENTUBE - Open Source (flex based) Video Sharing Application
| Software Version     : 0.1
| Website              : http://opentube.info
| Blog                 : http://blog.opentube.info
| E-mail               : opentube@googlegroups.com
|
|**************************************************************************************************
| This source file is subject to the LGPL License Agreement, available online at:
| http://www.gnu.org/copyleft/lesser.html
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|
|**************************************************************************************************/
class SError {
    var $_errors;

    function create() {
        return new SError();
    }

    function add($error) {
        global $SError;
        if (!isset($SError)) {
            SError::create();
        }
        $SError->_errors[] = $error;
    }

    function getErrors() {
        global $SError;
        if (!isset($SError)) {
            SError::create();
        }
        return $SError->_errors;
    }

    function getLastError() {
        global $SError;
        if (!isset($SError)) {
            SError::create();
        }
        return $SError->_errors[count($SError->_errors)-1];
    }

    function clear() {
        global $SError;
        if (!isset($SError)) {
            SError::create();
        }
        $SError->_errors = array();
        return false;
    }
}

?>